<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.yaodian100.mall.member.util.UserData"%>
<%@page import="org.apache.commons.lang.StringUtils"%>
<%@page import="com.yaodian100.core.common.utils.ServerValue"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt"%>
<c-rt:set var="frontContextPath" value='<%=ServerValue.getFrontHostname()+ServerValue.getFrontContextPath()%>'/>
<script type="text/javascript" charset="UTF-8" src="/js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" charset="UTF-8" src="/js/jquery-ui-1.7.2.custom.min.js"></script>
<script language="javascript">
	$().ready(function(){
		//login redirect
		$("#tologin").click(function(){
			$.post("${frontContextPath}/checkLogin.do",{pathparam:'<%=ServerValue.getFrontHostname()%>'+window.location.pathname+location.search},callback,"json");
			function callback(result){
				if(result!='login'){
					window.location.href = "${frontContextPath}/tologin.do?redirect_url="+result; 
				}
			}
		});
		
		$("#tologout").click(function(){
			window.location.href = '${frontContextPath}/logout.do?pathparam='+'<%=ServerValue.getFrontHostname()%>'+window.location.pathname+location.search;
			return false;
		});
	});
</script>
<div class="top-bar">
	<div class="fast-link">
		<a href="${frontContextPath}/shopping/cart.do" class="icon-car">购物车</a> 
		<a href="${frontContextPath}/member/myCollection/toproductc.do" class="icon-collect">收藏盒</a> 
		<a href="${frontContextPath}/member/myyaodian.do" class="icon-myaccont">我的耀点100</a> 
		<a href="<%=ServerValue.getFrontHostname()%>/help/" class="icon-help">帮助中心</a> 
	</div>
	<p id='loginInfo'>
	<%
	UserData userData = new UserData(request,response);
	if(StringUtils.isBlank(userData.getLoginId())){
	%>
		您好，欢迎光临耀点100 <a href="javascript:;" id="tologin">【登录】</a> | <a href="${frontContextPath}/toreg.do">【免费注册】</a>
	<%
	}else{
	%>
		亲爱的 <strong><%=userData.getLoginId()%></strong> 会员您好 <a href="javascript:;" id="tologout">【退出登录】</a>
	<%} %>
	</p>
</div>